home *** CD-ROM | disk | FTP | other *** search
- /* domerge.c - merge parts of external sort */
- #include "stdio.h"
- #include "merge1.h"
-
-
- int domerge(scra,scrb,tofile,nruns)
- char scra[] ; /* input scratch files on 1st pass */
- char scrb[] ; /* output scratch files on 1st pass */
- char tofile[] ; /* put final output here */
- int nruns ; /* number of runs on 1st pass */
- {
- while( nruns > 1 )
- { if( nruns <= MAX_MERGE )
- strcpy(scrb,tofile) ; /* last pass - output to file */
- nruns = dopass(scra,scrb,nruns) ; /* do merge pass */
- swap_str(scra,scrb) ; /* swap input and output */
- }
- }
-
-
-